<template>
	<view class="container">
		<!-- #ifdef MP-WEIXIN -->
		<authorize></authorize>
		<!-- #endif -->
		<view class="o-plr o-pb">
			<view v-if="list&&list.length > 0">
				<view v-for="(item,index) in list" :key="index" class="o-bt">
					<view class="c-tc o-pt o-mt">{{item.regionName}}</view>
					<view @click="goDetail(opt.ele.id)" v-for="(opt,idx) in item.ele" :key="idx" class="c-line-13 c-bg-f o-plr o-ptb-s o-mt c-r-l u-b">
						<view class="u-bb o-pb">
							<view class="l-fjb">
								<view class="l-f2">
									电梯注册代码：{{opt.ele.elevCode}}
								</view>
								<view class="l-f1 c-tr">
									取消关注
								</view>
							</view>
							<view class="">
								<text class="c-ws">安装地址：</text>
								{{opt.ele.location}}
							</view>
							<view class="">
								<text class="c-ws">详细位置：</text>
								{{opt.ele.locationDetail}}
							</view>
							<view class="l-fjb">
								<view class="l-fa">
									高峰等梯时间：{{opt.eleStatistics.waitEleTime}}秒
								</view>
								<view class="l-fa c-tr">
									已安全运行{{opt.eleStatistics.safeDistance}}天
								</view>
								<view class="l-fa c-tr">
									<text class="o-pr">{{opt.eleStatistics.desc}}</text>
									<u-icon name="arrow-right" color="#8b8b8b" size="28"></u-icon>
								</view>
							</view>
						</view>
						
						<view class="o-pt c-line-13">
							<view class="">日均数据</view>
							<view class="l-fjb">
								<view class="l-f1">
									运行距离：{{opt.eleStatistics.distance}}KM
								</view>
								<view class="l-f1">
									运行次数：{{opt.eleStatistics.runNum}}次
								</view>
							</view>
							<view class="l-fjb">
								<view class="l-f1">
									运行时间：{{opt.eleStatistics.runTime}}小时
								</view>
								<view class="l-f1">
									开关门次数：{{opt.eleStatistics.openDoorNum}}次
								</view>
							</view>
						</view>
						
					</view>
				</view>
				<load-more :status="status"></load-more>
			</view>
			
			<view v-else>
				<empty></empty>
			</view>
			
		</view>
	</view>
</template>

<script>
	import empty from '@/components/empty.vue'
	import loadMore from '@/components/load-more.vue'
	export default {
		data() {
			return {
				status: 'nomore'
			}
		},
		components:{empty, loadMore},
		computed: {
			list: vm => vm.$store.getters.eleList
		},
		onLoad() {
			this.init()
		},
		methods: {
			init() {
				this.getList()
			},
			getList() {
				this.$store.dispatch('get_EleList',{})
			},
			goDetail(eleId) {
				this.$store.dispatch('scan_Code',{eleId:eleId})
				// this.$Function.LinkTo('/pages/home/ele-details')
			}
		},
		
	}
</script>

<style>
	
</style>
